﻿using System;
using System.ComponentModel.DataAnnotations;
using CRM.Models.Email;

namespace CRM.ViewModels.Email;

public class EmailBlackListCreateVM
{
    public int Id { get; set; }
    public int OemId { get; set; }
    public int CompanyId { get; set; }
    public int GroupId { get; set; }
    public int UserId { get; set; }
    [MinLength(1)]
    public string Email { get; set; }
    public string Remark { get; set; }

    public EmailBlackList NewModel(Models.User user)
    {
        return new() {
            OemId = user.OemId, 
            CompanyId = user.CompanyId,
            GroupId = user.GroupId,
            UserId = user.Id,
            Email = Email,
            Remark = Remark,
            CreatedAt = DateTime.Now
        };
    }
    public EmailBlackList EditModel(EmailBlackList model)
    {
        model.Email = Email;
        model.Remark = Remark;
        return model;
    }
        
}